Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 2 - AppleScript Language Reference
Chapter 7 - Control Statements / With Timeout Statements


With Timeout

With Timeout statements let you change how long AppleScript can wait before stopping execution of application and scripting addition commands that are sent to other applications.

SYNTAX
with timeout [ of ] integer second[s]
   [ statement ]...
end [ timeout ] 
where

integer is an integer that specifies the amount of time, in seconds, AppleScript allows for each application command or command addition contained in
the With Timeout statement that is sent to any application other than the current one.

statement is any AppleScript statement.

EXAMPLE
The following With Timeout statement gives the user five minutes, instead of the usual one minute, to type in his or her name.

try
   with timeout of 300 seconds
      tell application "Scriptable Text Editor"         display dialog "What is your name?" ¬
            default answer ""      end tell
   end timeout
on error
   beep
end 

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996